#pragma once
#include <YSimpleSystem/YProactorToken.h>
#include <WinSock2.h>

namespace ysimple_network
{
	struct IRecvCallback;
	struct ITCPSession;

	class YProactorTokenOnRecv :
		public ysimple_system::YProactorToken
	{
		IRecvCallback*	m_pCallback;
		WSABUF			m_wsabuf;
		char				m_buf[1024*4];
		ITCPSession*			m_pSession;
	public:
		YProactorTokenOnRecv(void);
		virtual ~YProactorTokenOnRecv(void);

		void				beginInit(IRecvCallback& callback, ITCPSession& session);		
		void				endInit(bool success);
		bool				onCompleted(bool completionStatus, LONG_PTR		completionKey, DWORD			dwBytesTransfered ) override;
		WSABUF&		getWSABuf();
		DWORD			getWSABufCount();
	};

}

